<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        ul{
            width: 600px;
            padding: 0;
            margin: 0;
            list-style-type: none;
        }
        ul>li{
            overflow: hidden;
            padding: 0px;
            border-bottom: solid 1px gray;
        }
        ul>li>span{
            float: left;
            width: 200px;
        }
    </style>
    <script src="../lib/jquery-1.11.3.min.js"></script>
</head>
<body>
    <!-- <div id="tip">...</div>
    <div id="tip2">...</div>
    <div><input type="text" id="name"></div>
    <button>操作带标签内容</button>
    <button>控制纯文本内容</button>
    <button>改变文本框内容</button> -->
    <ul>
        <li>
            <span>选择</span>
            <span>名称</span>
            <span>价格</span>
        </li>
        <li>
            <span><input type="checkbox"></span>
            <span>手机</span>
            <span>5000</span>
        </li>
        <li>
            <span><input type="checkbox"></span>
            <span>图书</span>
            <span>200</span>
        </li>
        <li>
            <span><input type="checkbox"></span>
            <span>电脑</span>
            <span>3000</span>
        </li>
        <div>
            <input type="checkbox" name="" id="all">全选
        </div>
    </ul>
    <script>
        // $('button')[0].onclick=function(){
        //     $('#tip').html('<b>今天可能会下雨</b>')
        // }
        // $('button')[1].onclick=function(){
        //     $('#tip2').text('明天又是一个大晴天')
        // }
        // $('button')[2].onclick=function(){
        //     $('#name').val('请输入你的姓名')
        // }
        $('#all').on('click',function(){
            if($('#all').prop('checked')){
                $('li span input').prop('checked',true)
            }else{
                $('li span input').prop('checked',false)
            }
        })
    </script>
</body>
</html>